<?php 
	// require the database constants defined in constants.php in order to properly open connection
	// if a different connection is desired, simply change it in constants.php
	require("./includes/constants.php");
	
	//grab connection to server and mysql
	$connection = mysql_connect(DB_SERVER, DB_USER, DB_PASSWORD);
	
	// test connection and throw error if connection attempt failed
	if(!$connection)
	{
		die("DATABASE CONNECTION FAILED	".mysql_error());
	}
	
	// if connection established select cms_development 
	$db_select = mysql_select_db(DB_NAME, $connection);
	
	// throw error should selection of cms_development database fail
	if(!$db_select)
	{
		die("Database selection failed: ".mysql_error());
	}
?>

